﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FoodManager
{
    public class Functions
    {
        public static string GetStringTrangThai(int trangthai)
        {
            switch (trangthai)
            {
                case 1: return "Hiện";
                case 0: return "Ẩn";
                case 2: return "Nổi bật";
                default: return "hiện";
            }
        }
        public static int GetIntTrangThai(string trangthai)
        {
            switch (trangthai)
            {
                case "Hiện": return 1;
                case "Ẩn": return 0;
                case "Nổi bật": return 2;
                default: return 1;
            }
        }
        public static int GetIdCurrentUser()
        {
            if (!Program.CurrentUser.IsLogin) return 0;
            return Program.CurrentUser.Id;
        }
    }
}
